/*
 * @lc app=leetcode.cn id=771 lang=javascript
 *
 * [771] 宝石与石头
 */

// @lc code=start
/**
 * @param {string} jewels
 * @param {string} stones
 * @return {number}
 */
var numJewelsInStones = function(jewels, stones) {
  let set = new Set()
  let count = 0
  for (const item of jewels) {
    set.add(item)
  }
  for (const item of stones) {
    if (set.has(item)) count++    
  }
  return count
};
// @lc code=end

